package com.example.testminio;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lxb
 * @date 2021-11-14 20:54
 */
@RestController
public class TestController {

    @Autowired
    private FileUploader fileUploader;

    @GetMapping("test")
    public void test(){
        String bucket = "blog";
        String uploadFileName = "封面.png";
	    String sourceFile = "C:\\Users\\Administrator\\Desktop\\study-notes\\Java基础\\img\\封面.png";
	    String localSource = "C:\\Users\\Administrator\\Desktop\\img\\封面.png";
        fileUploader.uploadFile(bucket, uploadFileName, sourceFile);
        fileUploader.getFileUrl(bucket, uploadFileName);
        fileUploader.downloadFile(bucket, uploadFileName, localSource);
        fileUploader.getFileInfo(bucket, uploadFileName);
    }

}
